const path = require('path');
const webpack = require('webpack');
module.exports = {
    mode: "development",
    entry:{
        react:['react','react-dom']
    },
    output: {
        filename: "_dll_[name].js",
        path: path.resolve('dll'),
        library:'_dll_[name]', //打包后的赋值变量
        libraryTarget: "var" //打包时的变量赋值形式，默认值var,常用有commonjs
    },
    plugins: [
        new webpack.DllPlugin({ //提前打包webpack自带插件
            name: "_dll_[name]", //对应的output.library
            path:path.resolve(__dirname,'dll','manifest.json') //提前打包好后的生成文件 ./dist/manifest.json
        })
    ]
};
